﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Windows.Documents;

namespace MoneyWentWhere.DataModel.Tx
{
    public class NormalTxSettings : TxSettings
    {
        public override TransactionKind Kind
        {
            get { return TransactionKind.Normal; }
        }

        TagSet Tags;
        public NormalTxSettings(TagSet tags)
        {
            if (tags == null) { tags = TagSet.Empty; }
            Tags = tags;
        }

        new public static NormalTxSettings Parse(String rep)
        {
            TagSet tags = TagSet.Parse(rep);
            return new NormalTxSettings(tags);
        }
        public override string ToRepString()
        {
            return Tags.ToString();
        }

        new internal static NormalTxSettings Create(Transaction t)
        {
            return new NormalTxSettings(t.Tags);
        }

        protected override void ApplyCore(Transaction t)
        {
            t.Tags = Tags;
        }

    }
}
